import request from '@/utils/request'
// ========================= 管理 ======================================
// Get Record
export const QueryDataNeed = (page, pageSize, state) => {
  return request({
    url: '/v1/prse/dataNeed/manage/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
      state,
    },
  })
}

// Dispatch Record
export const DispatchDataNeed = (data) => {
  return request({
    url: '/v1/prse/dataNeed/manage/',
    method: 'post',
    data,
  })
}

// ------------------------- 用户 --------------------------------------

// Create My Record
export const CreateDataNeedRecord = (data) => {
  return request({
    url: '/v1/prse/dataNeed/my/',
    method: 'post',
    data,
  })
}

// Query My Record
export const QueryDataNeedRecord = (page, pageSize) => {
  return request({
    url: '/v1/prse/dataNeed/my/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
    },
  })
}

// Evaluate My Record
export const EvaluateMyRecord = (data) => {
  return request({
    url: '/v1/prse/dataNeed/myEvaluate/',
    method: 'post',
    data,
  })
}

// Preview My File
export const GetMyRecordPreviewImages = (rid) => {
  return request({
    url: '/v1/prse/dataNeed/my/dataPreView/',
    method: 'get',
    params: { rid },
  })
}

// ============================== 工作者 =========================
// Get Record
export const QueryDataNeedToMe = (page, pageSize, state) => {
  return request({
    url: '/v1/prse/dataNeed/worker/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
      state,
    },
  })
}

// Post Annex File
export const FinishAnnexdataNeedToMe = (data) => {
  return request({
    url: '/v1/prse/dataNeed/worker/',
    method: 'post',
    data,
  })
}
